using UnityEngine;
using DG.Tweening;
using Zhen;

public class ImageTapAnimator : MonoBehaviour
{
    // Start is called before the first frame update
    private RectTransform rectTransform;
    void Start()
    {
        RegisterEvent();
    }
    void Awake()
    {

        rectTransform = gameObject.GetComponent<RectTransform>();
    }
    void Update()
    {

    }
    void RegisterEvent()
    {
        EventTriggerManager.Get(gameObject).onDown += RunPointerDownAnim;
        EventTriggerManager.Get(gameObject).onUp += RunPointerUpAnim;


    }
    private void RunPointerDownAnim(GameObject go)
    {
        rectTransform.DOScale(new Vector3(0.9f, 0.9f, 1f), 0.1f);
    }
    private void RunPointerUpAnim(GameObject go)
    {
        rectTransform.DOScale(new Vector3(1f, 1f, 1f), 0.2f);
    }
}